<!DOCTYPE html>

<head>
    <link rel="shortcut icon" href="./images/icon.png" type="image/x-icon" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<link rel="stylesheet" href="css/iconfont/iconfont.css">
	<link rel="stylesheet" href="css/easyui/easyui.css">
	<link rel="stylesheet" href="css/easyui/icon.css">
	<link rel="stylesheet" href="css/css.css">
	<link rel="stylesheet" href="css/site.css">

	<script src="js/common/jQuery.js"></script>
	<script src="js/common/jquery.easyui.min.js"></script>
	<script src="js/common/app.js"></script>
	<script src="js/common/common.js"></script>
	<script src="js/common/slidebar.js"></script>

</head>

<body class="easyui-layout">
<title>东明后勤资产管理系统</title>
	<!-- 正上方panel -->
	<div data-options="region:'north',title:'顶部',split:true" style="height:70px;padding: 10px;">
		欢迎你，<input style="border:none;" type="text" id="username" readonly="readonly"></input>所在门店为&nbsp;<input style="border:none;" type="text" id="store" readonly="readonly"></span>
		<input type="button" value="退出登录" style="float: right" onclick="backToLogin()"/>
		<script>
            function backToLogin(){
                top.location.href = "login.html";
			}
		</script>
	</div>
	<!-- 正左方 -->
	<div data-options="region:'west',title:'菜单栏',split:true" style="width:200px;padding1:1px;overflow:hidden;">

		<div class="easyui-accordion" style="position: absolute; top: 27px; left: 0px; right: 0px; bottom: 0px;">

			<div title="基础信息" selected="true" iconcls="icon-save" style="overflow: auto; padding: 10px;">
				<ul id="LeftTree1" class="easyui-tree tree-hit"></ul>

			</div>
			<!--<div title="核查盘点管理" iconcls="icon-reload" style="padding: 10px;">
				<ul class="easyui-tree" id="LeftTree2"></ul>
			</div>-->
			<div title="维护管理" iconcls="icon-reload" style="padding: 10px;">
				<ul class="easyui-tree" id="LeftTree3"></ul>
			</div>
			<div title="设置" iconcls="icon-reload" style="padding: 10px;">
				<ul class="easyui-tree" id="LeftTree2"></ul>
			</div>
		</div>
	</div>
	<!-- 正中间 -->
	<div data-options="region:'center',title:'功能区'" style="padding:5px;background:#eee;">
		<div class="easyui-tabs" id="Tabs" fit="true" border="false">
			<div title="欢迎页" style="padding:20px;overflow:hidden;">
				<div style="margin-top:20px;">
					<h1>你好，欢迎来到东明后勤管理系统</h1>
				</div>
			</div>
		</div>
	</div>
	 <div data-options="region:'south',title:' ',split:true" style="height:100px;"align="center">
		 <div class="bottom">
			 ©1988 DMGJ
			 <span>东明（国际）家居博览有限公司</span>
			 <img width="13" height="16" src="">
		 </div>
	 </div>

</body>

<script type="text/javascript">
	/**  
	 * 创建新选项卡  
	 * @param title    选项卡标题  
	 * @param url      选项卡远程调用路径  
	 */
	function AddTab(title, url) {
		if($("#Tabs").tabs("exists", title)) {
			$("#Tabs").tabs("select", title);
		} else {
			CreateFrame(url);
			$("#Tabs").tabs("add", {
				title: title,
				content: CreateFrame(url),
				closable: true,
				cache: false
			});
		}

	}

	function CreateFrame(url) {
		var content = "<iframe src='" + url + "' width='100%' height='100%' frameborder='0' scrolling='auto' ></iframe>";
		return content;
	}

	//动态创建树菜单
	$(function() {
		$.ajax({
		url: "./goLogis/initPage", //请求的url地址
		xhrFields: {
      				withCredentials: true
   				},
		dataType: "json", //返回格式为json
		type: "GET", //请求方式
		processData: false, //对表单data数据是否进行序列化
		contentType: false, //dataType设置你收到服务器数据的格式
		headers: {
			'Content-Type': 'application/json'
		},
		beforeSend: function() {
			//请求前的处理
		},
		success: function(data) {
            var parentstore = data.store;
            if(parentstore!="数信网办公室"&&parentstore!="集团办公室"){
                var isornot = document.getElementById("LeftTree2");
                isornot.style.display='none';
            }

			if(data.status=="-1"){
				top.location.href = "login.html";
			}else if(data.status=="1"){
				$("#username").attr("value",data.username);
				$("#store").attr("value",data.store);
			}else{
				top.location.href = "login.html";
			}

		},
		complete: function() {
			//请求完成的处理
		},
		error: function() {
		}
	});
		/*加载树*/
		$("#LeftTree1").tree({

			data: [{
				"id": "1",
				"text": "资产基本资料",
				"state": "closed",
				//创建子节点   
				"children": [{
					"id": "1.1",
					"lines":true,
					"text": "资产基本资料查询页",
					"url": "view/equBasic/equbasic.html",
					/* "checked":true,  */
				}] // END children    
			}],
			onClick: function(node) {
				//判断点击的节点是否是子节点是子节点就添加tab,否则就return打开这个节点
				var Nodes = $(this).tree("isLeaf", node.target);
				if(Nodes == false) {
					return;
				} else {
					AddTab(node.text, node.url);
				}
			}

		});
		$("#LeftTree2").tree({

			data: [{
				"id": "1",
				"text": "下拉框设置",
				"state": "closed",
				//创建子节点
				"children": [{
					"id": "1.1",
					"text": "设置",
					"url": "view/setting/setting.html",
					/* "checked":true,  */
				}] // END children
			}],
			onClick: function(node) {
				//判断点击的节点是否是子节点是子节点就添加tab,否则就return打开这个节点
				var Nodes = $(this).tree("isLeaf", node.target);
				if(Nodes == false) {
					return;
				} else {
					AddTab(node.text, node.url);
				}
			}

		});
		$("#LeftTree3").tree({

			data: [{
				"id": "1",
				"text": "维修保养",
				"state": "closed",
				//创建子节点   
				"children": [{
					"id": "1.1",
					"text": "维修设备查询页",
					"url": "view/equConserve/equconserve.html",
					/* "checked":true,  */
				}] // END children    
			}],
			onClick: function(node) {
				//判断点击的节点是否是子节点是子节点就添加tab,否则就return打开这个节点
				var Nodes = $(this).tree("isLeaf", node.target);
				if(Nodes == false) {
					return;
				} else {
					AddTab(node.text, node.url);
				}
			}

		});

	});
</script>

</html>